﻿using Terraria.DataStructures;
using Terraria.GameContent.Creative;
using Terraria.ID;
using Terraria;
using Terraria.ModLoader;
using EAS.Common.Players;

namespace EAS.Content.Items
{
    public class OilBarrel : ModItem
    {
        public override void SetStaticDefaults()
        {
            CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
            Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(20, 7));
            ItemID.Sets.AnimatesAsSoul[Item.type] = true;
        }


        public override void SetDefaults()
        {
            Item.width = 24;
            Item.height = 36;
            Item.rare = ItemRarityID.Lime;
            Item.accessory = true;
            Item.value = Item.sellPrice(0, 4, 5, 0);
        }

        public override void AddRecipes()
        {
            Recipe modRecipe = Recipe.Create(Type, 1);
            modRecipe.AddIngredient(ItemID.SoulofFright, 10);
            modRecipe.AddIngredient(ItemID.TurtleShell, 1);
            modRecipe.AddIngredient(ItemID.ChlorophyteBar, 5);
            modRecipe.AddTile(TileID.MythrilAnvil);
            modRecipe.Register();
        }


        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            player.GetModPlayer<AccPlayer>().oilBarrel = true;
        }
    }
}
